package person.xjl.spring;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringTest {
    @Test
    public void test(){
       // ApplicationContext ac=new ClassPathXmlApplicationContext("beans.xml");
//        Car mary= (Car) ac.getBean("mary");
//        Car handou= (Car) ac.getBean("handou");
//        System.out.println(mary);
//        System.out.println(handou);
        //getBean里的参数放的是bean的id
//        Human song=(Human)ac.getBean("song");
//        Human jun=(Human)ac.getBean("jun");
//        System.out.println(song);
//        System.out.println(jun);
     //   Human aHao= (Human) ac.getBean("aHao");
     //   System.out.println(aHao);
        ApplicationContext ac=new ClassPathXmlApplicationContext("aop.xml");
        Math math= (Math) ac.getBean("math");
        math.add(100,5);
        math.subtract(100,5);
        math.mul(100,5);
        math.dev(100,5);
    }
}
